package com.apetrenko.avaya.callstore.client;


import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class RecordsLabelProvider implements LabelProvider {


	@Override
	public String getCellStyle(int aRow, int aColumn, Object aValue) {
		return "none";
	}

	@Override
	public Widget getCellWidget(int aRow, int aColumn, Object aValue) {
		Widget vWidget = null;
		if (aValue instanceof Record) {
			Record vRecord = (Record) aValue;
			switch(aColumn) {
			case 0:
				vWidget = new Label(vRecord.getOriginalName());
				break;
			case 1:
				vWidget = new Label(vRecord.getOperator());
				break;
			case 2:
				vWidget = new Label(vRecord.getDate());
				break;
			case 3:
				vWidget = new Label(vRecord.getDuration());
				break;
			case 4:
				vWidget = new Label(vRecord.getOriginator());
				break;
			default:
				vWidget = new Label("");	
			} 
		} else {
			vWidget = new Label("");
		}
		return vWidget;
	}


}
